<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="shortcut icon" href="../../docs/image3D.png">
    <script src="../../build/image3D.js"></script>
    <title>照相机着色器 | 测试</title>
</head>

<body>

    <canvas width=200 height=200>非常抱歉，您的浏览器不支持canvas!</canvas>

    <script>

        // 创建3D对象并配置好画布和着色器
        new image3D(document.getElementsByTagName('canvas')[0], {
            shader: "camera"
        })

            // 传递点的颜色
            .setAttributeFloat("a_color", 1.0, 0.0, 0.0)

            // 传递点的大小
            .setAttributeFloat('a_size', 50.0)

            // 传递点的位置
            .setAttributeFloat('a_position', 0.5, 0.25)

            // 传递照相机
            .setUniformMatrix("u_matrix", [

                // 注意：列主序
                -1, 0, 0, 0,
                0, 1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1
            ])

            .Painter()
            // 绘制
            .drawPoint(0, 1);


    </script>

</body>

</html>
